3.1.33 \(\int \frac {(a+b \sin (e+f x)) (A+B \sin (e+f x)+C \sin ^2(e+f x))}{\sin ^{\frac {3}{2}}(e+f x)} \, dx\) [33]

Optimal. Leaf size=117 \[ \frac {2 (b B-a (A-C)) E\left (\left .\frac {1}{2} \left (e-\frac {\pi }{2}+f x\right )\right |2\right )}{f}+\frac {2 (3 A b+3 a B+b C) F\left (\left .\frac {1}{2} \left (e-\frac {\pi }{2}+f x\right )\right |2\right )}{3 f}-\frac {2 a A \cos (e+f x)}{f \sqrt {\sin (e+f x)}}-\frac {2 b C \cos (e+f x) \sqrt {\sin (e+f x)}}{3 f} \]

[Out]

-2*(b*B-a*(A-C))*(sin(1/2*e+1/4*Pi+1/2*f*x)^2)^(1/2)/sin(1/2*e+1/4*Pi+1/2*f*x)*EllipticE(cos(1/2*e+1/4*Pi+1/2*
f*x),2^(1/2))/f-2/3*(3*A*b+3*B*a+C*b)*(sin(1/2*e+1/4*Pi+1/2*f*x)^2)^(1/2)/sin(1/2*e+1/4*Pi+1/2*f*x)*EllipticF(
cos(1/2*e+1/4*Pi+1/2*f*x),2^(1/2))/f-2*a*A*cos(f*x+e)/f/sin(f*x+e)^(1/2)-2/3*b*C*cos(f*x+e)*sin(f*x+e)^(1/2)/f

________________________________________________________________________________________

Rubi [A]
time = 0.14, antiderivative size = 117, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.122, Rules used = {3110, 3102, 2827, 2720, 2719} \begin {gather*} \frac {2 F\left (\left .\frac {1}{2} \left (e+f x-\frac {\pi }{2}\right )\right |2\right ) (3 a B+3 A b+b C)}{3 f}+\frac {2 E\left (\left .\frac {1}{2} \left (e+f x-\frac {\pi }{2}\right )\right |2\right ) (b B-a (A-C))}{f}-\frac {2 a A \cos (e+f x)}{f \sqrt {\sin (e+f x)}}-\frac {2 b C \sqrt {\sin (e+f x)} \cos (e+f x)}{3 f} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[((a + b*Sin[e + f*x])*(A + B*Sin[e + f*x] + C*Sin[e + f*x]^2))/Sin[e + f*x]^(3/2),x]

[Out]

(2*(b*B - a*(A - C))*EllipticE[(e - Pi/2 + f*x)/2, 2])/f + (2*(3*A*b + 3*a*B + b*C)*EllipticF[(e - Pi/2 + f*x)
/2, 2])/(3*f) - (2*a*A*Cos[e + f*x])/(f*Sqrt[Sin[e + f*x]]) - (2*b*C*Cos[e + f*x]*Sqrt[Sin[e + f*x]])/(3*f)

Rule 2719

Int[Sqrt[sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[(2/d)*EllipticE[(1/2)*(c - Pi/2 + d*x), 2], x] /; FreeQ[{
c, d}, x]

Rule 2720

Int[1/Sqrt[sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[(2/d)*EllipticF[(1/2)*(c - Pi/2 + d*x), 2], x] /; FreeQ
[{c, d}, x]

Rule 2827

Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[c, Int[(b*S
in[e + f*x])^m, x], x] + Dist[d/b, Int[(b*Sin[e + f*x])^(m + 1), x], x] /; FreeQ[{b, c, d, e, f, m}, x]

Rule 3102

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (
f_.)*(x_)]^2), x_Symbol] :> Simp[(-C)*Cos[e + f*x]*((a + b*Sin[e + f*x])^(m + 1)/(b*f*(m + 2))), x] + Dist[1/(
b*(m + 2)), Int[(a + b*Sin[e + f*x])^m*Simp[A*b*(m + 2) + b*C*(m + 1) + (b*B*(m + 2) - a*C)*Sin[e + f*x], x],
x], x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] &&  !LtQ[m, -1]

Rule 3110

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])*((A_.) + (B_.)*sin[(e
_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(-(b*c - a*d))*(A*b^2 - a*b*B + a^2*C)
*Cos[e + f*x]*((a + b*Sin[e + f*x])^(m + 1)/(b^2*f*(m + 1)*(a^2 - b^2))), x] - Dist[1/(b^2*(m + 1)*(a^2 - b^2)
), Int[(a + b*Sin[e + f*x])^(m + 1)*Simp[b*(m + 1)*((b*B - a*C)*(b*c - a*d) - A*b*(a*c - b*d)) + (b*B*(a^2*d +
 b^2*d*(m + 1) - a*b*c*(m + 2)) + (b*c - a*d)*(A*b^2*(m + 2) + C*(a^2 + b^2*(m + 1))))*Sin[e + f*x] - b*C*d*(m
 + 1)*(a^2 - b^2)*Sin[e + f*x]^2, x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, C}, x] && NeQ[b*c - a*d, 0] &&
NeQ[a^2 - b^2, 0] && LtQ[m, -1]

Rubi steps

\begin {align*} \int \frac {(a+b \sin (e+f x)) \left (A+B \sin (e+f x)+C \sin ^2(e+f x)\right )}{\sin ^{\frac {3}{2}}(e+f x)} \, dx &=-\frac {2 a A \cos (e+f x)}{f \sqrt {\sin (e+f x)}}-2 \int \frac {\frac {1}{2} (-A b-a B)-\frac {1}{2} (b B-a (A-C)) \sin (e+f x)-\frac {1}{2} b C \sin ^2(e+f x)}{\sqrt {\sin (e+f x)}} \, dx\\ &=-\frac {2 a A \cos (e+f x)}{f \sqrt {\sin (e+f x)}}-\frac {2 b C \cos (e+f x) \sqrt {\sin (e+f x)}}{3 f}-\frac {4}{3} \int \frac {\frac {1}{4} (-3 A b-3 a B-b C)-\frac {3}{4} (b B-a (A-C)) \sin (e+f x)}{\sqrt {\sin (e+f x)}} \, dx\\ &=-\frac {2 a A \cos (e+f x)}{f \sqrt {\sin (e+f x)}}-\frac {2 b C \cos (e+f x) \sqrt {\sin (e+f x)}}{3 f}-(-b B+a (A-C)) \int \sqrt {\sin (e+f x)} \, dx-\frac {1}{3} (-3 A b-3 a B-b C) \int \frac {1}{\sqrt {\sin (e+f x)}} \, dx\\ &=\frac {2 (b B-a (A-C)) E\left (\left .\frac {1}{2} \left (e-\frac {\pi }{2}+f x\right )\right |2\right )}{f}+\frac {2 (3 A b+3 a B+b C) F\left (\left .\frac {1}{2} \left (e-\frac {\pi }{2}+f x\right )\right |2\right )}{3 f}-\frac {2 a A \cos (e+f x)}{f \sqrt {\sin (e+f x)}}-\frac {2 b C \cos (e+f x) \sqrt {\sin (e+f x)}}{3 f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.54, size = 97, normalized size = 0.83 \begin {gather*} -\frac {6 (b B+a (-A+C)) E\left (\left .\frac {1}{4} (-2 e+\pi -2 f x)\right |2\right )+2 (3 A b+3 a B+b C) F\left (\left .\frac {1}{4} (-2 e+\pi -2 f x)\right |2\right )+\frac {2 \cos (e+f x) (3 a A+b C \sin (e+f x))}{\sqrt {\sin (e+f x)}}}{3 f} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[((a + b*Sin[e + f*x])*(A + B*Sin[e + f*x] + C*Sin[e + f*x]^2))/Sin[e + f*x]^(3/2),x]

[Out]

-1/3*(6*(b*B + a*(-A + C))*EllipticE[(-2*e + Pi - 2*f*x)/4, 2] + 2*(3*A*b + 3*a*B + b*C)*EllipticF[(-2*e + Pi
- 2*f*x)/4, 2] + (2*Cos[e + f*x]*(3*a*A + b*C*Sin[e + f*x]))/Sqrt[Sin[e + f*x]])/f

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(515\) vs. \(2(169)=338\).
time = 6.13, size = 516, normalized size = 4.41

method result size
default \(\frac {-A \sqrt {1+\sin \left (f x +e \right )}\, \sqrt {2-2 \sin \left (f x +e \right )}\, \sqrt {-\sin \left (f x +e \right )}\, \EllipticF \left (\sqrt {1+\sin \left (f x +e \right )}, \frac {\sqrt {2}}{2}\right ) a +A b \sqrt {1+\sin \left (f x +e \right )}\, \sqrt {2-2 \sin \left (f x +e \right )}\, \sqrt {-\sin \left (f x +e \right )}\, \EllipticF \left (\sqrt {1+\sin \left (f x +e \right )}, \frac {\sqrt {2}}{2}\right )+2 A \sqrt {1+\sin \left (f x +e \right )}\, \sqrt {2-2 \sin \left (f x +e \right )}\, \sqrt {-\sin \left (f x +e \right )}\, \EllipticE \left (\sqrt {1+\sin \left (f x +e \right )}, \frac {\sqrt {2}}{2}\right ) a +a B \sqrt {1+\sin \left (f x +e \right )}\, \sqrt {2-2 \sin \left (f x +e \right )}\, \sqrt {-\sin \left (f x +e \right )}\, \EllipticF \left (\sqrt {1+\sin \left (f x +e \right )}, \frac {\sqrt {2}}{2}\right )+B b \sqrt {1+\sin \left (f x +e \right )}\, \sqrt {2-2 \sin \left (f x +e \right )}\, \sqrt {-\sin \left (f x +e \right )}\, \EllipticF \left (\sqrt {1+\sin \left (f x +e \right )}, \frac {\sqrt {2}}{2}\right )-2 B b \sqrt {1+\sin \left (f x +e \right )}\, \sqrt {2-2 \sin \left (f x +e \right )}\, \sqrt {-\sin \left (f x +e \right )}\, \EllipticE \left (\sqrt {1+\sin \left (f x +e \right )}, \frac {\sqrt {2}}{2}\right )+a C \sqrt {1+\sin \left (f x +e \right )}\, \sqrt {2-2 \sin \left (f x +e \right )}\, \sqrt {-\sin \left (f x +e \right )}\, \EllipticF \left (\sqrt {1+\sin \left (f x +e \right )}, \frac {\sqrt {2}}{2}\right )+\frac {C \sqrt {1+\sin \left (f x +e \right )}\, \sqrt {2-2 \sin \left (f x +e \right )}\, \sqrt {-\sin \left (f x +e \right )}\, \EllipticF \left (\sqrt {1+\sin \left (f x +e \right )}, \frac {\sqrt {2}}{2}\right ) b}{3}-2 a C \sqrt {1+\sin \left (f x +e \right )}\, \sqrt {2-2 \sin \left (f x +e \right )}\, \sqrt {-\sin \left (f x +e \right )}\, \EllipticE \left (\sqrt {1+\sin \left (f x +e \right )}, \frac {\sqrt {2}}{2}\right )-\frac {2 C \left (\cos ^{2}\left (f x +e \right )\right ) \sin \left (f x +e \right ) b}{3}-2 A a \left (\cos ^{2}\left (f x +e \right )\right )}{\cos \left (f x +e \right ) \sqrt {\sin \left (f x +e \right )}\, f}\) \(516\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*sin(f*x+e))*(A+B*sin(f*x+e)+C*sin(f*x+e)^2)/sin(f*x+e)^(3/2),x,method=_RETURNVERBOSE)

[Out]

(-A*(1+sin(f*x+e))^(1/2)*(2-2*sin(f*x+e))^(1/2)*(-sin(f*x+e))^(1/2)*EllipticF((1+sin(f*x+e))^(1/2),1/2*2^(1/2)
)*a+A*b*(1+sin(f*x+e))^(1/2)*(2-2*sin(f*x+e))^(1/2)*(-sin(f*x+e))^(1/2)*EllipticF((1+sin(f*x+e))^(1/2),1/2*2^(
1/2))+2*A*(1+sin(f*x+e))^(1/2)*(2-2*sin(f*x+e))^(1/2)*(-sin(f*x+e))^(1/2)*EllipticE((1+sin(f*x+e))^(1/2),1/2*2
^(1/2))*a+a*B*(1+sin(f*x+e))^(1/2)*(2-2*sin(f*x+e))^(1/2)*(-sin(f*x+e))^(1/2)*EllipticF((1+sin(f*x+e))^(1/2),1
/2*2^(1/2))+B*b*(1+sin(f*x+e))^(1/2)*(2-2*sin(f*x+e))^(1/2)*(-sin(f*x+e))^(1/2)*EllipticF((1+sin(f*x+e))^(1/2)
,1/2*2^(1/2))-2*B*b*(1+sin(f*x+e))^(1/2)*(2-2*sin(f*x+e))^(1/2)*(-sin(f*x+e))^(1/2)*EllipticE((1+sin(f*x+e))^(
1/2),1/2*2^(1/2))+a*C*(1+sin(f*x+e))^(1/2)*(2-2*sin(f*x+e))^(1/2)*(-sin(f*x+e))^(1/2)*EllipticF((1+sin(f*x+e))
^(1/2),1/2*2^(1/2))+1/3*C*(1+sin(f*x+e))^(1/2)*(2-2*sin(f*x+e))^(1/2)*(-sin(f*x+e))^(1/2)*EllipticF((1+sin(f*x
+e))^(1/2),1/2*2^(1/2))*b-2*a*C*(1+sin(f*x+e))^(1/2)*(2-2*sin(f*x+e))^(1/2)*(-sin(f*x+e))^(1/2)*EllipticE((1+s
in(f*x+e))^(1/2),1/2*2^(1/2))-2/3*C*cos(f*x+e)^2*sin(f*x+e)*b-2*A*a*cos(f*x+e)^2)/cos(f*x+e)/sin(f*x+e)^(1/2)/
f

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(f*x+e))*(A+B*sin(f*x+e)+C*sin(f*x+e)^2)/sin(f*x+e)^(3/2),x, algorithm="maxima")

[Out]

integrate((C*sin(f*x + e)^2 + B*sin(f*x + e) + A)*(b*sin(f*x + e) + a)/sin(f*x + e)^(3/2), x)

________________________________________________________________________________________

Fricas [C] Result contains higher order function than in optimal. Order 9 vs. order 4.
time = 0.12, size = 249, normalized size = 2.13 \begin {gather*} \frac {\sqrt {2} \sqrt {-i} {\left (3 \, B a + {\left (3 \, A + C\right )} b\right )} \sin \left (f x + e\right ) {\rm weierstrassPInverse}\left (4, 0, \cos \left (f x + e\right ) + i \, \sin \left (f x + e\right )\right ) + \sqrt {2} \sqrt {i} {\left (3 \, B a + {\left (3 \, A + C\right )} b\right )} \sin \left (f x + e\right ) {\rm weierstrassPInverse}\left (4, 0, \cos \left (f x + e\right ) - i \, \sin \left (f x + e\right )\right ) - 3 \, \sqrt {2} \sqrt {-i} {\left (i \, {\left (A - C\right )} a - i \, B b\right )} \sin \left (f x + e\right ) {\rm weierstrassZeta}\left (4, 0, {\rm weierstrassPInverse}\left (4, 0, \cos \left (f x + e\right ) + i \, \sin \left (f x + e\right )\right )\right ) - 3 \, \sqrt {2} \sqrt {i} {\left (-i \, {\left (A - C\right )} a + i \, B b\right )} \sin \left (f x + e\right ) {\rm weierstrassZeta}\left (4, 0, {\rm weierstrassPInverse}\left (4, 0, \cos \left (f x + e\right ) - i \, \sin \left (f x + e\right )\right )\right ) - 2 \, {\left (C b \cos \left (f x + e\right ) \sin \left (f x + e\right ) + 3 \, A a \cos \left (f x + e\right )\right )} \sqrt {\sin \left (f x + e\right )}}{3 \, f \sin \left (f x + e\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(f*x+e))*(A+B*sin(f*x+e)+C*sin(f*x+e)^2)/sin(f*x+e)^(3/2),x, algorithm="fricas")

[Out]

1/3*(sqrt(2)*sqrt(-I)*(3*B*a + (3*A + C)*b)*sin(f*x + e)*weierstrassPInverse(4, 0, cos(f*x + e) + I*sin(f*x +
e)) + sqrt(2)*sqrt(I)*(3*B*a + (3*A + C)*b)*sin(f*x + e)*weierstrassPInverse(4, 0, cos(f*x + e) - I*sin(f*x +
e)) - 3*sqrt(2)*sqrt(-I)*(I*(A - C)*a - I*B*b)*sin(f*x + e)*weierstrassZeta(4, 0, weierstrassPInverse(4, 0, co
s(f*x + e) + I*sin(f*x + e))) - 3*sqrt(2)*sqrt(I)*(-I*(A - C)*a + I*B*b)*sin(f*x + e)*weierstrassZeta(4, 0, we
ierstrassPInverse(4, 0, cos(f*x + e) - I*sin(f*x + e))) - 2*(C*b*cos(f*x + e)*sin(f*x + e) + 3*A*a*cos(f*x + e
))*sqrt(sin(f*x + e)))/(f*sin(f*x + e))

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\left (a + b \sin {\left (e + f x \right )}\right ) \left (A + B \sin {\left (e + f x \right )} + C \sin ^{2}{\left (e + f x \right )}\right )}{\sin ^{\frac {3}{2}}{\left (e + f x \right )}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(f*x+e))*(A+B*sin(f*x+e)+C*sin(f*x+e)**2)/sin(f*x+e)**(3/2),x)

[Out]

Integral((a + b*sin(e + f*x))*(A + B*sin(e + f*x) + C*sin(e + f*x)**2)/sin(e + f*x)**(3/2), x)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(f*x+e))*(A+B*sin(f*x+e)+C*sin(f*x+e)^2)/sin(f*x+e)^(3/2),x, algorithm="giac")

[Out]

integrate((C*sin(f*x + e)^2 + B*sin(f*x + e) + A)*(b*sin(f*x + e) + a)/sin(f*x + e)^(3/2), x)

________________________________________________________________________________________

Mupad [B]
time = 14.85, size = 169, normalized size = 1.44 \begin {gather*} \frac {2\,B\,b\,\mathrm {E}\left (\frac {e}{2}-\frac {\pi }{4}+\frac {f\,x}{2}\middle |2\right )}{f}-\frac {2\,B\,a\,\mathrm {F}\left (\frac {\pi }{4}-\frac {e}{2}-\frac {f\,x}{2}\middle |2\right )}{f}-\frac {2\,A\,b\,\mathrm {F}\left (\frac {\pi }{4}-\frac {e}{2}-\frac {f\,x}{2}\middle |2\right )}{f}+\frac {2\,C\,a\,\mathrm {E}\left (\frac {e}{2}-\frac {\pi }{4}+\frac {f\,x}{2}\middle |2\right )}{f}-\frac {A\,a\,\cos \left (e+f\,x\right )\,{\left ({\sin \left (e+f\,x\right )}^2\right )}^{1/4}\,{{}}_2{\mathrm {F}}_1\left (\frac {1}{2},\frac {5}{4};\ \frac {3}{2};\ {\cos \left (e+f\,x\right )}^2\right )}{f\,\sqrt {\sin \left (e+f\,x\right )}}-\frac {C\,b\,\cos \left (e+f\,x\right )\,{\sin \left (e+f\,x\right )}^{5/2}\,{{}}_2{\mathrm {F}}_1\left (-\frac {1}{4},\frac {1}{2};\ \frac {3}{2};\ {\cos \left (e+f\,x\right )}^2\right )}{f\,{\left ({\sin \left (e+f\,x\right )}^2\right )}^{5/4}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((a + b*sin(e + f*x))*(A + B*sin(e + f*x) + C*sin(e + f*x)^2))/sin(e + f*x)^(3/2),x)

[Out]

(2*B*b*ellipticE(e/2 - pi/4 + (f*x)/2, 2))/f - (2*B*a*ellipticF(pi/4 - e/2 - (f*x)/2, 2))/f - (2*A*b*ellipticF
(pi/4 - e/2 - (f*x)/2, 2))/f + (2*C*a*ellipticE(e/2 - pi/4 + (f*x)/2, 2))/f - (A*a*cos(e + f*x)*(sin(e + f*x)^
2)^(1/4)*hypergeom([1/2, 5/4], 3/2, cos(e + f*x)^2))/(f*sin(e + f*x)^(1/2)) - (C*b*cos(e + f*x)*sin(e + f*x)^(
5/2)*hypergeom([-1/4, 1/2], 3/2, cos(e + f*x)^2))/(f*(sin(e + f*x)^2)^(5/4))

________________________________________________________________________________________